package com.spring.starter.redis;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.redisson.config.SingleServerConfig;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @auther zhangwj
 * @date 2020/7/10 6:04 下午
 */
@Configuration
public class RedisSession {

    @Bean
    public RedissonClient config() {
        Config config = new Config();
        SingleServerConfig singleServerConfig = config.useSingleServer();
        singleServerConfig.setAddress("redis://47.96.106.60:6379");
        singleServerConfig.setPassword("xinfengwei,2019");
        return Redisson.create(config);
    }
}
